import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';

/// 根据flutter_smart_dialog重新封装toast工具
class AppToast {
  AppToast._();

  static void showToast(String message) {
    SmartDialog.showToast(
      "",
      builder: (context) {
        return Container(
          padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h),
          margin: EdgeInsets.only(bottom: 80.h),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(8.r),
            boxShadow: [
              BoxShadow(
                color: Colors.black.withAlpha(50),
                blurRadius: 30.w,
                spreadRadius: 0.w,
                offset: const Offset(0, 5)
              ),
            ],
          ),
          child: Text(
            message,
            style: TextStyle(
              fontSize: 24.sp,
              color: Colors.black
            ),
          ),
        );
      }
    );
  }
}